home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / Photoshop 4.0 SDK r2 Mac / Examples / Filter / Dissolve-sans-AppleScript / Common / DissolveSans.r < prev    next >
Text File  |  1996-11-08  |  8KB  |  325 lines

  1. /*
  2.     File: DissolveSans.r
  3.  
  4.     Copyright (c) 1990-1, Thomas Knoll.
  5.     Copyright (c) 1992-6, Adobe Systems Incorporated.
  6.     All rights reserved.
  7.  
  8.     Rez source file for DissolveSans example.
  9. */
  10.  
  11. /*********************************************************************/
  12. /* Defines required for include file */
  13.  
  14. #define plugInName            "Dissolve-sans-AppleScript"
  15. #define VersionString        "4.0"
  16.  
  17. /*********************************************************************/
  18.  
  19. #if Macintosh
  20. #include "Types.r"
  21. #include "SysTypes.r"
  22. #include "PIGeneral.r"
  23. #include "PIUtilities.r"
  24. #include "DialogUtilities.r"
  25. #endif
  26.  
  27. #if MSWindows
  28. #include "PIGeneral.h"
  29. #include "PIUtilities.r"
  30. #include "WinDialogUtils.r"
  31. #endif
  32.  
  33. #include "PIActions.h"
  34.  
  35. /********************************************************************************/
  36.  
  37. #define plugInComment         "dissolvesans example filter plug-in"
  38. #define vendorName            "AdobeSDK"
  39.  
  40. #define keyDisposition         'disP'
  41. #define keyEntireImage        'entI'
  42. #define typeMood            'mooD'
  43. #define dispositionClear    'moD0'
  44. #define dispositionCool        'moD1'
  45. #define dispositionHot        'moD2'
  46. #define dispositionSick        'moD3'
  47.  
  48. #define ourSuiteID            'sdK1'
  49. #define ourClassID            ourSuiteID
  50. #define ourEventID            ourClassID
  51.  
  52. /*********************************************************************/
  53.  
  54. resource 'PiPL' (ResourceID, purgeable)
  55.     {
  56.         {
  57.         Kind { Filter },
  58.         Name { plugInName "..." },
  59.         Category { "Noise" },
  60.         Version { (latestFilterVersion << 16) | latestFilterSubVersion },
  61.  
  62.         #if Macintosh
  63.         Code68K { Filter, $$ID },
  64.         CodePowerPC { 0, 0, "" },
  65.         #endif
  66.  
  67.         #if MSWindows
  68.         CodeWin32X86 { "ENTRYPOINT" },
  69.         #endif
  70.         
  71.         HasTerminology { ourClassID, ourEventID, ResourceID, vendorName " " plugInName },
  72.         /* classID, eventID, aete ID, uniqueString */
  73.         
  74.         SupportedModes
  75.             {
  76.             noBitmap, doesSupportGrayScale,
  77.             noIndexedColor, doesSupportRGBColor,
  78.             doesSupportCMYKColor, doesSupportHSLColor,
  79.             doesSupportHSBColor, doesSupportMultichannel,
  80.             doesSupportDuotone, doesSupportLABColor
  81.             },
  82.             
  83.         EnableInfo { "in (PSHOP_ImageMode, GrayScaleMode, RGBMode,"
  84.                          "CMYKMode, HSLMode, HSBMode, MultichannelMode,"
  85.                          "DuotoneMode, LabMode)" },
  86.  
  87.         FilterCaseInfo
  88.             {
  89.                 {
  90.                 /* Flat data, no selection */
  91.                 inWhiteMat, outStraightData,
  92.                 doNotWriteOutsideSelection,
  93.                 filtersLayerMasks, worksWithBlankData,
  94.                 doNotCopySourceToDestination,
  95.                     
  96.                 /* Flat data with selection */
  97.                 inWhiteMat, outStraightData,
  98.                 writeOutsideSelection,
  99.                 filtersLayerMasks, worksWithBlankData,
  100.                 doNotCopySourceToDestination,
  101.                 
  102.                 /* Floating selection */
  103.                 inWhiteMat, outStraightData,
  104.                 writeOutsideSelection,
  105.                 filtersLayerMasks, worksWithBlankData,
  106.                 doNotCopySourceToDestination,
  107.                     
  108.                 /* Editable transparency, no selection */
  109.                 inWhiteMat, outStraightData,
  110.                 doNotWriteOutsideSelection,
  111.                 filtersLayerMasks, worksWithBlankData,
  112.                 doNotCopySourceToDestination,
  113.                     
  114.                 /* Editable transparency, with selection */
  115.                 inWhiteMat, outStraightData,
  116.                 writeOutsideSelection,
  117.                 filtersLayerMasks, worksWithBlankData,
  118.                 doNotCopySourceToDestination,
  119.                     
  120.                 /* Preserved transparency, no selection */
  121.                 inWhiteMat, outStraightData,
  122.                 doNotWriteOutsideSelection,
  123.                 filtersLayerMasks, worksWithBlankData,
  124.                 doNotCopySourceToDestination,
  125.                     
  126.                 /* Preserved transparency, with selection */
  127.                 inWhiteMat, outStraightData,
  128.                 writeOutsideSelection,
  129.                 filtersLayerMasks, worksWithBlankData,
  130.                 doNotCopySourceToDestination
  131.                 }
  132.             }    
  133.         }
  134.     };
  135.  
  136. resource 'PiMI' (ResourceID, purgeable)
  137.       latestFilterVersion,
  138.       latestFilterSubVersion,
  139.       0,
  140.       supportsGrayScale +
  141.           supportsRGBColor +
  142.         supportsCMYKColor +
  143.         supportsHSLColor +
  144.         supportsHSBColor +
  145.         supportsMultichannel +
  146.         supportsDuotone +
  147.         supportsLABColor,
  148.       '    ', /* No required host */
  149.       {},
  150. };
  151.  
  152. /* About resources */
  153.  
  154. resource StringResource (AboutID, "About Text", purgeable)
  155. {
  156.     plugInName "\n\n"
  157.     "Version " VersionString " "
  158.     "Release " ReleaseString "\n"
  159.     "Copyright ⌐ 1992-6, Adobe Systems Incorporated.\n"
  160.     "All rights reserved.\n\n"
  161.     "An example plug-in filter module for Adobe Photoshop¿."
  162. };
  163.  
  164. /* Parameters dialog box */
  165.  
  166. resource 'DLOG' (ResourceID+1, "UI", purgeable)
  167. {
  168.     {96, 148, 208, 444},
  169.     movableDBoxProc,
  170.     visible,
  171.     noGoAway,
  172.     0x0,
  173.     ResourceID+1,
  174.     plugInName
  175. };
  176.  
  177. resource 'DITL' (ResourceID+1, "UI", purgeable)
  178. {
  179.     {    /* array DITLarray: 11 elements */
  180.         /* [1] */
  181.         {8, 228, 28, 288},
  182.         Button {
  183.             enabled,
  184.             "OK"
  185.         },
  186.         /* [2] */
  187.         {36, 228, 56, 288},
  188.         Button {
  189.             enabled,
  190.             "Cancel"
  191.         },
  192.         /* [3] */
  193.         {8, 161, 24, 190},
  194.         EditText {
  195.             enabled,
  196.             ""
  197.         },
  198.         /* [4] */
  199.         {8, 77, 24, 153},
  200.         StaticText {
  201.             disabled,
  202.             "Amount %:"
  203.         },
  204.         /* [5] */
  205.         {4, 8, 64, 68},
  206.         UserItem {
  207.             disabled
  208.         },
  209.         /* [6] */
  210.         {40, 72, 56, 153},
  211.         StaticText {
  212.             disabled,
  213.             "Disposition:"
  214.         },
  215.         /* [7] */
  216.         {40, 156, 56, 214},
  217.         RadioButton {
  218.             enabled,
  219.             "Clear"
  220.         },
  221.         /* [8] */
  222.         {56, 156, 72, 214},
  223.         RadioButton {
  224.             enabled,
  225.             "Cool"
  226.         },
  227.         /* [9] */
  228.         {72, 156, 88, 214},
  229.         RadioButton {
  230.             enabled,
  231.             "Hot"
  232.         },
  233.         /* [10] */
  234.         {88, 156, 104, 214},
  235.         RadioButton {
  236.             enabled,
  237.             "Sick"
  238.         },
  239.         /* [11] */
  240.         {88, 8, 104, 112},
  241.         CheckBox {
  242.             enabled,
  243.             "Entire image"
  244.         }
  245.     }
  246. };
  247.  
  248. /* Scripting resource */
  249.  
  250. resource 'aete' (ResourceID, purgeable)
  251. {
  252.     1, 0, english, roman,                                    /* aete version and language specifiers */
  253.     {
  254.         vendorName,                                            /* vendor suite name */
  255.         "Adobe example plug-ins",                            /* optional description */
  256.         ourSuiteID,                                            /* suite ID */
  257.         1,                                                    /* suite code, must be 1 */
  258.         1,                                                    /* suite level, must be 1 */
  259.         {                                                    /* structure for filters */
  260.             "dissolve",                                        /* unique filter name */
  261.             "dissolve plug-in filter w/o AppleScript",        /* optional description */
  262.             ourClassID,                                        /* class ID, must be unique or Suite ID */
  263.             ourEventID,                                        /* event ID, must be unique to class ID */
  264.             
  265.             NO_REPLY,                                        /* never a reply */
  266.             IMAGE_DIRECT_PARAMETER,                            /* direct parameter, used by Photoshop */
  267.             {                                                /* parameters here, if any */
  268.                 "amount",                                    /* parameter name */
  269.                 keyAmount,                                    /* parameter key ID */
  270.                 typeFloat,                                    /* parameter type ID */
  271.                 "dissolve amount",                            /* optional description */
  272.                 flagsSingleParameter,                        /* parameter flags */
  273.                 
  274.                 "disposition",                                // second parameter
  275.                 keyDisposition,                                // parameter key ID
  276.                 typeMood,                                    // parameter type ID
  277.                 "dissolve disposition",                        // optional description
  278.                 flagsEnumeratedParameter,                    // parameter flags
  279.                 
  280.                 "entire image",                                /* optional parameter */
  281.                 keyEntireImage,                                /* key ID */
  282.                 typeBoolean,                                /* type */
  283.                 "filter entire image",                        /* optional desc */
  284.                 flagsSingleParameter                        /* parameter flags */
  285.  
  286.             }
  287.         },
  288.         {                                                    /* non-filter plug-in class here */
  289.         },
  290.         {                                                    /* comparison ops (not supported) */
  291.         },
  292.         {                                                    /* any enumerations */
  293.             typeMood,                                        /* type disposition 'mooD' */
  294.             {
  295.                 "clear",                                    /* first value */
  296.                 dispositionClear,                            /* 'moD0' */
  297.                 "clear headed",                                /* optional description */
  298.                 
  299.                 "cool",                                        /* second value */
  300.                 dispositionCool,                            /* 'moo1' */
  301.                 "got the blues",                            /* optional description */
  302.                 
  303.                 "hot",                                        /* third value */
  304.                 dispositionHot,                                /* 'moo2' */
  305.                 "red-faced",                                /* optional description */
  306.                 
  307.                 "sick",                                        /* fourth value */
  308.                 dispositionSick,                            /* 'moo3' */
  309.                 "green with envy"                            /* optional description */
  310.             }
  311.                 
  312.         }
  313.     }
  314. };
  315.  
  316. //========================================================================================
  317. // Animation resource for use in Premiere
  318. //========================================================================================
  319. resource 'FltD' (1000, "") {
  320.     {
  321.         pdShort, 0,        // Interpolate the dissolve amount
  322.     };
  323. };
  324.